package cn.stu.system.controller;


import cn.stu.common.utils.R;
import cn.stu.framework.entity.SysExpression;
import cn.stu.framework.service.ISysExpressionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 流程达式Controller
 *
 * @author ruoyi
 * @date 2022-12-12
 */
@RestController
@RequestMapping("/system/expression")
public class SysExpressionController {
    @Autowired
    private ISysExpressionService sysExpressionService;

    /**
     * 查询流程达式列表
     */
    @GetMapping("/list")
    public R list(SysExpression sysExpression) {
        return sysExpressionService.selectSysExpressionList(sysExpression);

    }


    /**
     * 获取流程达式详细信息
     */
    @GetMapping(value = "/{id}")
    public R getInfo(@PathVariable("id") Long id) {
        return sysExpressionService.selectSysExpressionById(id);
    }

    /**
     * 新增流程达式
     */
    @PostMapping
    public R add(@RequestBody SysExpression sysExpression) {
        return sysExpressionService.insertSysExpression(sysExpression);
    }

    /**
     * 修改流程达式
     */
    @PutMapping
    public R edit(@RequestBody SysExpression sysExpression) {
        return sysExpressionService.updateSysExpression(sysExpression);
    }

    /**
     * 删除流程达式
     */
    @DeleteMapping("/{ids}")
    public R remove(@PathVariable Long[] ids) {
        return sysExpressionService.deleteSysExpressionByIds(ids);
    }
}
